<?php

use Phinx\Migration\AbstractMigration;

class AddUpdatedColumnInSupplierTable extends AbstractMigration
{


    public function up()
    {
        $this->table("supplier")
            ->addColumn('updated', 'integer', ['signed' => false, 'default' => 0, 'null' => false, 'limit' => 11, 'comment' => '更新时间'])
            ->addColumn('created_by', 'integer', ['signed' => false, 'default' => 0, 'null' => false, 'limit' => 11, 'comment' => '添加人'])
            ->addColumn('framework_agreement_contract_id', 'string', ['default' => '', 'limit' => 32, 'comment' => 'FDD框架协议合同id'])
            ->addColumn('framework_agreement_status', 'enum', ['values' => 'to_be_submitted,wait_for_sign,signed', 'default' => 'to_be_submitted', 'comment' => 'FDD框架协议签订状态'])
            ->save();
    }

    public function down()
    {
        $this->table("supplier")
            ->removeColumn("updated")
            ->removeColumn("created_by")
            ->removeColumn("framework_agreement_contract_id")
            ->removeColumn("framework_agreement_status")
            ->save();
    }
}
